var layerId;
$(function(){
	$("#add-button").click(function(){
		layerId=layer.open({
			title: "添加用户",
			area: ['1200px','700px'],
			fix:true,
			type: 2,
			content: basePath+'/admin/add.shtml'
		});
	});
	$("#search-button").click(function(){
		var keyword=$("input[name='keyword']").val();
		var url=basePath+"/admin/query.shtml?pageNo=1"+"&keyword="+keyword;
		window.location.href=url;
	});
})
function fanye(pageNo){
	var url=basePath+"/admin/query.shtml?pageNo="+pageNo+"&keyword="+init.keyword;
	window.location.href=url;
}

function editFun(adminId){
	layerId=layer.open({
		title: "修改用户信息",
		area: ['1200px','700px'],
		fix:true,
		type: 2,
		content: basePath+'/admin/edit.shtml?adminId='+adminId
	});
}

function deleteFun(adminId){
	if(confirm("确认删除？")){
		 $.ajax({
	  		 url:basePath+"/admin/delete.shtml?adminId="+adminId,  
	  		 type:"post",
	  		 dataType:"JSON",
	  		 success:ajaxSuccessRefreshFun
	  	 });
	}
}
function updateStatus(adminId,status){
	$.ajax({
		url:basePath+"/admin/updateStatus.shtml?adminId="+adminId+"&status="+status,  
		type:"post",
		dataType:"JSON",
		success:ajaxSuccessRefreshFun
	});
}
